ul.breadcrumb.height37
	li
		a(href='/portal/index') 首页
	li.sep >
	li.cd 基金产品
a(href='#/fund/filter')
	img.mbottom20(src='/img/fund_ad.gif', width=980, height=100)
.border.border-arc
	.fd-mod1
		.yui3-g.wrap
			.yui3-u-1-4
				.padleft20.padright10.mtop20
					.clearfix
						.icon-cls.pull-left
						.fd-icon-desc.pull-left.mleft15.mtop5
							span.cn.nomp 按分类选基金
							p.cn-desc 基金可以按照基金类型分
					
					nav
						a(href='#/fund/filter', title='更多').pull-right
							img.fd-more(src='img/blank.gif')
						each type in ['货币型'/*,'理财型'*/,'混合型','债券型','股票型']
							.fd-enum5.bright.tac
								a(href='#/fund/filter?q=/基金/#{type}', title=type).lbc= type

			.yui3-u-1-4
				.bleft.padleft20.mtop20.padright10
					.clearfix
						.icon-risk.pull-left
						.fd-icon-desc.pull-left.mleft15.mtop5
							span.cn.nomp 按风险选基金
							p.cn-desc 基金可以按照风险类型分
					
					nav
						a(href='#/fund/filter', title='更多').pull-right
							img.fd-more(src='img/blank.gif')
						each risk,index in ['低','较低','中','较高','高']
							.fd-enum51.bright.tac
								a(href='#/fund/filter?risk_level=#{index+1}', title=risk).lbc= risk

			.yui3-u-1-4
				.bleft.padleft20.mtop20.padright10
					.clearfix
						.icon-eva.pull-left
						.fd-icon-desc.pull-left.mleft15.mtop5
							span.cn.nomp 按评价选基金
							p.cn-desc 基金可以按照评分标准分
					
					nav
						a(href='#/fund/filter', title='更多').pull-right
							img.fd-more(src='img/blank.gif')
						each star,index in ['五星','四星','三星','两星','一星']
							.fd-enum51.bright.tac
								a(href='#/fund/filter?star=#{5-index}', title=star).lbc= star
					
			.yui3-u-1-4
				.bleft.padleft20.mtop20.padright10
					.clearfix
						.icon-com.pull-left
						.fd-icon-desc.pull-left.mleft15.mtop5
							span.cn.nomp 按公司选基金
							p.cn-desc 基金可以按照公司名称分
							
					nav
						a(href='#/fund/filter', title='更多').pull-right
							img.fd-more(src='img/blank.gif')
						//-
							#content
								.fd-enum4(ng-repeat='fund in products').mright5.bright.padright5
									a(href='#/fund/filter?vendor={{fund.vendor}}', title='{{fund.title}}').lbc {{fund.title}}
						a(href='#/fund/filter?vendor=广发基金', title='广发基金').fd-enum4.mright5.bright.lbc 广发基金
						a(href='#/fund/filter?vendor=嘉实基金', title='嘉实基金').fd-enum4.mright5.bright.lbc 嘉实基金
						a(href='#/fund/filter?vendor=博时基金', title='博时基金').fd-enum4.mright5.bright.lbc 博时基金	

cache = {}
each item in trace.items
	category = item.extra.category[0].split('/').pop()
	list = cache[category] || (cache[category] = [])
	- list.push(item)

.fd-mod2.mtop20.clearfix

	section.left.pull-left
		a(href='#/fund/compare')
			img(src='/img/fund_compare.png')
		.border.border-arc.mtop15(ng-init="expandIndex=0", style='overflow: hidden;')
			.font22(style='line-height:50px;background-color:#f9f9f9;text-indent:20px') 新基金推荐

			each sub,index in newproducts.items.slice(0, 3)
				.btop(ng-class="{graybg: expandIndex!=#{index}}")
					.padleft20.padright20
						.fd-tt
							img(src='img/blank.gif', ng-class='{down: expandIndex!=#{index}}', ng-click='expandIndex=#{index}').cp
							.tt.b.ft
								a(href='#/fund/detail?pid=#{sub.id}').link= sub.title
					ul(ng-show='expandIndex==#{index}', style='height: 110px').mtop5.mleft20.mright20.fd-info

						li
							| 基金代码:
							span.b= sub.code
						li
							| 类型:
							span.b= sub.extra.category[0].split('/').pop()
						li
							| 发售时间:
							span.b= (sub.extra&&sub.extra.subscription_date&&sub.extra.subscription_date[0])?sub.extra.subscription_date[0].slice(0,10):''
							| 到
							span.b= (sub.extra&&sub.extra.subscription_date&&sub.extra.subscription_date[1])?sub.extra.subscription_date[1].slice(0,10):''
						if sub.hot >= 0
							a(href='#/fund/detail?pid=#{sub.id}').buy.b.mtop10 购买
						a.fundCompare.mleft10.mtop10(href='#/fund/compare?ids=#{sub.id}') 基金对比
	section.right.border.border-arc.pull-right(ng-init="tabnum=1")

		.topic-pane.border-arc-tl.border-arc-tr.bbottom
			.topic 基金跟踪与投资建议
			.fund-tab1(ng-class="{actv1: tabnum==1, cp: tabnum!=1}", ng-click="tabnum=1")
				.fund-tab1-icon
				.tac.b 股票型
			.fund-tab2(ng-class="{actv2: tabnum==2, cp: tabnum!=2}", ng-click="tabnum=2") 
				.fund-tab2-icon
				.tac.b 混合型
			.fund-tab3(ng-class="{actv3: tabnum==3, cp: tabnum!=3}", ng-click="tabnum=3")
				.fund-tab3-icon
				.tac.b 债券型
		
		fundRiskLevelLabels = ['默认等级', '低','较低','中','较高','高'];
		each cat,index in ['股票型', '混合型', '债券型']
			row = cache[cat].slice(0, 2)
			yui3_g = row.length > 1 ? 'yui3-g' : ''
			yui3_u_1_2 = row.length == 2 ? 'yui3-u-1-2' : ''
			.mtop30(ng-show='tabnum==#{index+1}', class='#{yui3_g}')
				each val,i in row
					div(class='#{yui3_u_1_2}')
						clazz = []
						if i==0 && row.length > 1
							- clazz.push('bright')

						.padleft15.padright15(class=clazz.join(' '))
							.padbottom8.bbottom(style='border-bottom-style: dashed;')
								span.triangle.mright8
								a(href='#/fund/detail?pid=#{val.id}').b.tt= val.title
							
							.fd-info.bbottom(style='border-bottom-style: dashed;')
								ul.fd-desc
									li
										| 基金类型: 
										b.mrem= val.extra.category[0].split('/').pop()
										| 配置风险: 
										b= fundRiskLevelLabels[val.risk_level]
									li 近一周表现: 
										b.mrem= Number(val.extra.yieldrate1w).toFixed(2)+'%'
										| 近三个月表现: 
										b= Number(val.extra.yieldrate3m).toFixed(2)+'%'
							
							.mtop8.padbottom8.bbottom(style='border-bottom-style: dashed;')
								span.triangle.mright8
								span.b.fd-info 业绩点评与投资建议
								
							ul.fd-desc(style='height: 52px;')
								if row.length > 1
									li
										a.cp(href='javascript:void(0);', ng-click='dialog.fundTip=true;___content="#{val.promotion}";___title="业绩点评与投资建议"') #{(val.promotion && val.promotion.substring(0, 68))}...
								else
									li
										a.cp(href='javascript:void(0);', ng-click='dialog.fundTip=true;___content="#{val.promotion}";___title="业绩点评与投资建议"') #{(val.promotion && val.promotion.substring(0, 140))}...
							
							.border0.mtop30
								a(href='#/fund/detail?pid=#{val.id}').link.pull-right 详情>
								if val.hot >= 0
									a(href='javascript:void(0)', ng-click="addToCart({product_id: '#{val.id}', period:0, count: #{val.extra.min_amount}, payment_type: #{val.extra.charge_type != 1 ? 0 : 1}})", ng-show="!cart.exists['#{val.id}'] && !pocket.exists['#{val.id}']").add2cart.tac.vam.b.ib
										span.buy-icon.mright5 &nbsp;
										| 加入购物车
									a(href='#/cart', ng-show="cart.exists['#{val.id}']").add2cart.tac.vc.b.ib
										span.buy-icon.mright5 &nbsp;
										| 查看购物车
								a.fundCompare.mleft10(href='#/fund/compare?ids=#{val.id}') 基金对比

.dialog.border.g.gf-dialog(fixed=1, ng-show='dialog.fundTip', gf-remove-class='hidden').hidden
	.close(ng-click='dialog.fundTip=false', title='关闭') &nbsp;
	.title.font16 {{___title}}
	.pad15(style='overflow-y:auto;height:115px;')
		{{___content}}
						
.fd-mod3.mbottom50
	.mtop20.border.border-arc
		.padleft20.padtop10.padbottom10.border-arc-tl.border-arc-tr
			.clearfix
				.icon-ccs.pull-left
				.fd-icon-desc.pull-left.mleft15.mtop15
					.topic 重点货币基金收益

		.border-arc-bl.border-arc-br.wbg
			.thead.tac.font14.b.bc
				.yui3-g
					.yui3-u-1-5(style='*width:19%')
						.padtop15.padbottom15 基金名称
					.yui3-u-1-5
						.padtop15.padbottom15(style='border-left: 1px solid #badbeb') 代码
					.yui3-u-1-5
						.padtop15.padbottom15(style='border-left: 1px solid #badbeb') 七天年化收益率
					.yui3-u-1-5
						.padtop15.padbottom15(style='border-left: 1px solid #badbeb') 万份日收益
					.yui3-u-1-5
						.padtop15.padbottom15(style='border-left: 1px solid #badbeb') 产品特点
			
			each p,i in cache['货币型']
				clazz = []
				if i%2 == 1
					- clazz.push('gray')
				if i==cache['货币型'].length-1
					- clazz.push('border-arc-bl')
					- clazz.push('border-arc-br')

				.yui3-g.tac.btop.sfc(class=clazz.join(' '))
					.yui3-u-1-5(style='*width:19%')
						.padtop15.padbottom15.font13
							a(href='#/fund/detail?pid=#{p.id}').link= p.title
					.yui3-u-1-5
						.padtop15.padbottom15.bleft.oneline= p.code
					.yui3-u-1-5
						.padtop15.padbottom15.bleft.oneline= Number(p.extra.annu_yield).toFixed(2)+'%'
					.yui3-u-1-5
						.padtop15.padbottom15.bleft.oneline= Number(p.extra.daily_return).toFixed(4)
					.yui3-u-1-5
						.padtop15.padbottom15.padleft5.padright5.bleft.oneline
							a.cp(href='javascript:void(0);', ng-click='dialog.fundTip=true;___content="#{p.extra.feature}";___title="产品特点"')= p.extra.feature
					
	.mtop20.border.border-arc
		.padleft20.padtop10.padbottom10.border-arc-tl.border-arc-tr
			.clearfix
				.icon-rcmd.pull-left
				.fd-icon-desc.pull-left.mleft15.mtop15
					.topic 定投组合推荐
			
		.border-arc-bl.border-arc-br.wbg
			.thead.font14.b.bc
				.yui3-g
					.yui3-u-1-5.tac
						.padtop15.padbottom15 定投目标
					.yui3-u-2-5.tac
						.padtop15.padbottom15(style='border-left: 1px solid #badbeb') 推荐基金品种及比例
					.yui3-u-2-5.tac
						.padtop15.padbottom15(style='border-left: 1px solid #badbeb') 推荐理由
				
			.tbody
				- function promotionfilter(str, category) {
				- 	if(!str || /^\d+\.?\%$/.test(str) || !category) {
				-		return [];
				-	} else {
				-		var p = new RegExp("^#"+category+"\\s*:\\s*([\\d%]+)$","m"), m = str.match(p);
				-		if (!m) {
				-			return [];
				-		}
				-		return m;
				-   }
				- }
				categories = ['小康置业', '教育储备', '安逸养老']
				aip = {}
				percentages = {}
				each item in aipdata.items
					each c in categories
						promotion = promotionfilter(item.promotion, c)
						if promotion.length
							list = aip[c]||(aip[c]=[]);
							percent = percentages[c]||(percentages[c]=[]);
							- list.push(item)
							- percent.push(promotion)
				
				each category,rownum in categories
					cell = aip[category]
					percentage = percentages[category]
					.yui3-g.btop.sfc(class= rownum%2==1 ? 'gray' : '')
						.yui3-u-1-5.tac.padtop30.nfc.font13
							.mright10(class='icon#{rownum+1}')
							.ib.vc= category
						.yui3-u-2-5.tac
							.bleft.padtop15.padbottom15
								.content
									.qtip-pos1.qtip.mbottom5
										.wrap
											.arrow(style='background: #36a0c8')
											= percentage[0][1]
									
									.qtip-pos2.c_progressBar
										.c_progressBarWrap
											.c_progress(ng-style="{width: '#{percentage[0][1]}'}")
											.c_progress2(ng-style="{width: '#{percentage[1][1]}'}")
										
									.qtip-pos3.qtip.mtop5(style='background: #f8935d')
										.wrap
											.arrow.arrow2
											= percentage[1][1]

									each pos,index in [1,2]
										ttpos = 'tt-pos' + pos
										div(class=ttpos)
											a(href='#/fund/detail?pid=#{cell[index].id}', title=cell[index].name).ib= cell[index].title
											.ib
												| (
												span= Number(cell[index].pricing[0].price).toFixed(4)
												| , 
												- clazz = []
												change_rate = cell[index].pricing[0].change_rate
												if change_rate > 0
													- clazz.push('rc')
													span.rc +
												if change_rate < 0
													- clazz.push('grc')
												span(class=clazz)= Number(change_rate).toFixed(2)+'%'
												| )

						.yui3-u-2-5.tac
							.bleft(style='height: 99px;')
								.vc.padleft30.padright30(style='height: 49px;line-height: 49px;')
									.oneline(style='width: 330px;')
										a.cp(href='javascript:void(0);', ng-click='dialog.fundTip=true;___content="#{cell[0].extra.rcmd_reason}";___title="推荐理由"')= cell[0].extra.rcmd_reason
								.bbottom
								.vc.padleft30.padright30(style='height: 49px;line-height: 49px;')
									.oneline(style='width: 330px;')
										a.cp(href='javascript:void(0);', ng-click='dialog.fundTip=true;___content="#{cell[1].extra.rcmd_reason}";___title="推荐理由"')= cell[1].extra.rcmd_reason

	.tar.afc.mtop10
		li
			| 更具体的定投明细收益计算请使用专业的
			a(href='http://www.gf.com.cn/fundAIPAction.do?method=list', target='_blank').link “基金定投计算器”
